<?php
$servername = "localhost";
$username = "clothshop";
$pwd = "123456";
$dbname = "clothshop";
//创建链接
$conn = new mysqli($servername, $username, $pwd, $dbname);
//检查链接
if ($conn->connect_error) {
    die("连接失败:" . $conn->connect_error);
}
mysqli_query($conn, "set names utf8");